import { Controller, Get, Module } from "@nestjs/common";
import { WebResult } from "src/common/web.result";
import * as path from "path";
import * as fs from "fs";
import * as JSON5 from "json5";

const configurationPath = path.join(__dirname, "../../config/android.json5");
const configuration = JSON5.parse(fs.readFileSync(configurationPath, "utf-8"));

@Controller("android")
export class AndroidController {
  constructor() {}

  @Get("/version")
  getAppVersion() {
    return WebResult.success(configuration);
  }
}

@Module({
  controllers: [AndroidController],
})
export class AndroidModule {}
